<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/16 0016
 * Time: 上午 0:30
 */

namespace Home\Controller;
use Think\Controller;

class SendMsgController extends Controller{
    public $model;
    public function __construct(){
        parent::__construct();
        $this->model = D('send_msg');
    }

    public function add_send_msg(){
        if(IS_POST){
            $data['send_id'] = I('post.userid');
            $data['receiver_id'] = I('post.kefuid');
            $data['connect'] = I('post.msg');
            $data['time'] = time();

            if($this->model->add($data)){
                $this->ajaxReturn('ok');
            }else{
                $this->ajaxReturn('fail');
            }
        }
    }

}